package process

import (
	"context"
	"quipus/internal/database/dao"
	"quipus/internal/database/model"
	"quipus/internal/llm"
	v1pb "quipus/proto/gen/api/v1"
)

type Process struct {
	Gds         *dao.GdsAccess
	WorkflowMap map[string]*LLMWorkflow
	DataPath    string
}

type LLMReq struct {
	Content        string
	History        *[]llm.RoleContent
	AskId          string
	InMessageChan  <-chan *v1pb.Exchange
	OutMessageChan chan<- *v1pb.Exchange
	AnswerChan     chan<- *v1pb.Exchange
}

func NewProcess(gds *dao.GdsAccess) *Process {
	return &Process{
		Gds:         gds,
		WorkflowMap: make(map[string]*LLMWorkflow),
	}
}

type LLM_Process interface {
	ProcessComplete(ctx context.Context, content string, srcKnot *model.Knot) (string, error)
	ProcessChat(ctx context.Context, req *LLMReq, srcKnot *model.Knot) error
}
